import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.Color;
import java.awt.Image.*;
import java.awt.image.*;
import javax.imageio.*;
import javax.swing.*;
import javax.swing.JComponent.*;

public class Resizer {
  BufferedImage img;
  BufferedImage newimg;
  public void crop(String filename) {
    try {
    img = ImageIO.read(new File(filename+".png"));
    }
    catch(IOException e) {
      System.out.println("Error1");
    }
    newimg = new BufferedImage(750,303,BufferedImage.TYPE_INT_RGB);
    for (int x = 0; x<750; x++) {
      int j = 295;
      for (int y = 0;j<598;y++) {
        newimg.setRGB(x,y,img.getRGB(x,j));
        j++;
      }
    }
    try {
      ImageIO.write(newimg,"png",new File(filename+"(resized).png"));
    }
    catch (IOException e){
      System.out.println("Error2");
    }
  }
}